package org.wmq.javafxmapcollectioncs.service.impl;

import org.wmq.javafxmapcollectioncs.mapper.MapEntityMapper;
import org.wmq.javafxmapcollectioncs.mapper.impl.MapEntityMapperImplByFileSystem;
import org.wmq.javafxmapcollectioncs.mapper.impl.MapEntityMapperImplByHttpAndMysql;
import org.wmq.javafxmapcollectioncs.model.Entity.MapEntity;
import org.wmq.javafxmapcollectioncs.service.MapEntityService;

public class MapEntityServiceImpl implements MapEntityService {
    private final MapEntityMapper mapEntityMapper = new MapEntityMapperImplByHttpAndMysql();
    @Override
    public MapEntity getById(Long id) {
        return this.mapEntityMapper.selectById(id);
    }

    @Override
    public void add(MapEntity mapEntity) {
        this.mapEntityMapper.insert(mapEntity);
    }

    @Override
    public void update(MapEntity mapEntity) {
        this.mapEntityMapper.update(mapEntity);
    }

    @Override
    public void deleteById(Long id) {
        this.mapEntityMapper.deleteById(id);
    }
}
